<template>
  <div class="app-container">
    <el-row :gutter="0">
      <!--专病数据-->
      <el-form class="formBox formBox1 searchForm" :model="queryParams" ref="queryForm" size="mini" :inline="true" v-show="showSearch"
               label-width="100px">
        <el-form-item label="医院" prop="hospital" clearable>
          <department :isHospital="true" :isdepat="true" @refreshData="refreshData" deptWidth="160px"
                      :isUserAll="true" ref="departments">
          </department>
        </el-form-item>
        <el-form-item>
          <el-button type="info" icon="el-icon-date" size="mini" @click="handleWeek(-1)"
                     :class="dateSelect == -1 ? 'btn' : ''">上一周({{ setWeekText(splitDate("", 1) - 1) }})</el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-date" size="mini" @click="handleWeek(0)"
                     :class="dateSelect == 0 ? 'btn' : ''">本周({{ setWeekText(splitDate("", 1)) }})</el-button>
        </el-form-item>
        <el-form-item>
          <el-button type="success" icon="el-icon-date" size="mini" @click="handleWeek(1)"
                     :class="dateSelect == 1 ? 'btn' : ''">下一周({{ setWeekText(splitDate("", 1) + 1) }})</el-button>
        </el-form-item>
        <el-form-item label="周次">
          <el-input v-model="weekNum" placeholder="周次" style="width:80px;margin:0 10px;"
                    @input="weekNum = weekNum.replace(/^(0+)|[^\d]+/g, '')" @keyup.enter.native="InputWeek"
                    class="inputNum" />

        </el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="InputWeek"
                   style="margin-right:10px;">搜索</el-button>

        <el-form-item label="自定义时间">
          <el-date-picker v-model="dateRange" style="width:270px" value-format="yyyy-MM-dd" type="daterange"
                          :picker-options="pickerOptions" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"
                          :clearable="false" @change="handleWeek(-2)"></el-date-picker>
        </el-form-item>

        <!-- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> -->

      </el-form>

      <el-form class="formBox formBox1 searchForm" :model="form" :rules="rules" ref="form" size="mini" :inline="true" v-show="showSearch"
               label-width="68px">
        <el-form-item label="科室" prop="deptId">

            <department :isAdd="true" @changedepatData="changedepatData" :HospitalId="form.hospitalId"
                      ref="department" deptWidth="160px" :isHeight="true" v-if="open" :deptIds="form.deptId" :isdisabled="false">
                    </department>

        </el-form-item>
        <el-form-item prop="schedulingDate">
          <el-date-picker v-model="form.schedulingDate" value-format="yyyy-MM-dd" type="date" placeholder="选择日期" class="appointePicker"
                          :picker-options="pickerOptions0" style="width:140px" @change="changedate" :clearable="false">
          </el-date-picker>
        </el-form-item>
        <el-form-item prop="week">
          <el-input v-model="form.week" placeholder="周几" :readonly="true" style="width:80px" />
        </el-form-item>
        <el-form-item prop="timeSlot">
          <el-select v-model="form.timeSlot" placeholder="时间" style="width:80px">
            <el-option v-for="dict in sysUseTypeArr" :key="dict.value" :label="dict.label"
                       :value="dict.value" />
          </el-select>
        </el-form-item>


        <el-form-item prop="appointmentsNumber">
          <!-- <el-input-number v-model="form.appointNum" placeholder="人数" controls-position="right"  :min="0" :max="9999" style="width:100px"></el-input-number> -->
          <el-input v-model="form.appointmentsNumber" placeholder="预约人数" style="width:80px"
                    @input="form.appointmentsNumber = form.appointmentsNumber.replace(/^(0+)|[^\d]+/g, '')"
                    class="inputNum" />
        </el-form-item>
        <el-form-item prop="schedulingDoctorUsername">
          <el-select v-model="form.schedulingDoctorUsername" filterable placeholder="请选择治疗医生" clearable
                     style="width: 140px" @change="getName(2)">
            <el-option v-for="item in treatmentDoctorUsersList" :key="item.userId" :label="item.nickName"
                       :value="item.userName"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="remark">
          <el-input v-model="form.remark" placeholder="备注" style="width: 140px" />
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="el-icon-plus" size="mini" plain @click="submitForm"
                     :disabled="form.schedulingId ? true : false">添加</el-button>
          <!-- <el-button type="danger" icon="el-icon-edit" :disabled="form.schedulingId ? false : true" size="small"
              plain @click="submitForm">修改</el-button> -->
          <el-button icon="el-icon-edit" size="mini" plain @click="reset">清空重置</el-button>
          <!-- <el-button type="info" icon="el-icon-edit-outline" size="small" plain
              @click="handleOldWeek(0)">引用上周</el-button> -->

        </el-form-item>
        <el-row>

          <el-collapse accordion style="border:none;width:100%;"
                       v-model="PlanactiveName" class="appointeCollapse">
            <el-collapse-item style="border:none" name="1">
              <template slot="title">
                <div style="color:black">
                  <span style="margin-right:10px;">治疗项目 </span>
                  <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll"
                               @change="handleCheckAllChange">全选</el-checkbox>
                </div>
              </template>
              <div style="margin:10px 0;"></div>
              <el-checkbox-group v-model="checkedCities" @change="handleCheckedCitiesChange"
                                 iconPlacement="left">
                <el-checkbox v-for="item in singlePlanList" :label="item" :key="item.planId">{{
                    item.medicalEquipment }}</el-checkbox>
              </el-checkbox-group>
            </el-collapse-item>
          </el-collapse>
          <!-- <el-select v-model="form.planId" filterable placeholder="请选择治疗项目" clearable style="width: 260px"
                  @change="getName(1)">
                  <el-option v-for="item in singlePlanList" :key="item.planId" :label="item.medicalEquipment"
                      :value="item.planId"></el-option>
              </el-select> -->
        </el-row>
      </el-form>
      <div class="formBox searchForm" style="margin-bottom:0px!important;" ref="statisticalTable">
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button type="danger" plain icon="el-icon-delete" size="mini" :disabled="multiple"
                       @click="handleDelete('', 2)">批量删除</el-button>
            <el-button type="success" plain icon="el-icon-delete" size="mini" :disabled="multiple"
                       @click="getenableSchedulingBatchEvent('', 3)">批量启用</el-button>
            <el-button type="success" icon="el-icon-folder-opened" size="mini"
                       @click="PreviewEvent">预览</el-button>

          </el-col>
          <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
        </el-row>
        <el-table border v-loading="loading" :data="tablesList" @selection-change="handleSelectionChange" :height="statisticalTableH"
          ref="table">
          <el-table-column type="selection" width="50" align="center" :selectable="rowable" />
          <!-- <el-table-column sortable label="序号" align="center" type="index" width="80">
              <template slot-scope="scope">
                  <span>{{ getIndex(scope.$index) }}</span>
              </template>
          </el-table-column> -->
          <!-- <el-table-column sortable label="标注设置名称" align="center" prop="markName" :show-overflow-tooltip="true"
              style="width:300" /> -->

          <el-table-column sortable label="日期" align="center" prop="schedulingDate" :show-overflow-tooltip="true"
                           width="100" />
          <el-table-column sortable label="周" align="center" prop="schedulingDate" :show-overflow-tooltip="true"
                           width="100">
            <template slot-scope="scope">
              <span>第{{ splitDate(scope.row.schedulingDate) }}周 </span>
            </template>
          </el-table-column>
          <el-table-column sortable label="星期" align="center" prop="week" :show-overflow-tooltip="true"
                           width="80">

          </el-table-column>


          <el-table-column sortable label="上、下午" width="120" align="center" prop="timeSlot"
                           :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <span v-if="scope.row.timeSlot == 0" style="color:rgb(255, 0, 170)">上午</span>
              <span v-else style="color:rgb(0, 174, 255)">下午</span>
            </template>
          </el-table-column>

          <el-table-column sortable label="是否启用" width="120" align="center" prop="status"
                           :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <span v-if="scope.row.status == 0" style="color:red">未启用</span>
              <span v-else style="color:blue">已启用</span>
            </template>
          </el-table-column>
          <el-table-column sortable label="治疗项目" width="200" align="center" prop="medicalEquipment"
                           :show-overflow-tooltip="true">

          </el-table-column>
          <el-table-column sortable label="可预约数" width="120" align="center" prop="appointmentsNumber"
                           :show-overflow-tooltip="true">
            <template slot-scope="scope">
              <el-input v-if="isUpdateRow == scope.row.schedulingId" v-model="scope.row.appointmentsNumber"
                        placeholder="预约人数" style="width:80px"
                        @input="scope.row.appointmentsNumber = scope.row.appointmentsNumber.replace(/[^0-9]/g, '')"
                        @blur="comfireBlur(scope.row)" class="inputNum" />

              <span v-else>{{ scope.row.appointmentsNumber }}</span>
            </template>
          </el-table-column>
          <el-table-column sortable label="治疗医生" width="120" align="center" prop="schedulingDoctorNickname"
                           :show-overflow-tooltip="true">

          </el-table-column>
          <el-table-column label="医院" align="center" prop="hospitalName" :show-overflow-tooltip="true"
                           width="150">
            <template slot-scope="scope">
              <departTag :options="deptNameLists" :value="scope.row.hospitalId" />
            </template>
          </el-table-column>
          <el-table-column label="科室" align="center" prop="deptName" :show-overflow-tooltip="true" width="150">
            <template slot-scope="scope">
              <departTag :options="deptNameLists" :value="scope.row.deptId" />
            </template>
          </el-table-column>
          <el-table-column sortable label="创建时间" align="center" prop="createTime" width="160">
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.createTime) }}</span>
            </template>
          </el-table-column>
          <el-table-column sortable label="备注" align="center" prop="remark" :show-overflow-tooltip="true">

          </el-table-column>

          <!-- <el-table-column  label="备注" align="center" prop="remark" :show-overflow-tooltip="true" /> -->
          <el-table-column label="操作" align="center" fixed="right" width="160"
                           class-name="small-padding fixed-width">
            <template slot-scope="scope">
              <el-button size="mini" type="text" icon="el-icon-edit"
                         v-if="selectable(scope.row) && scope.row.status == 0"
                         @click="getenableSchedulingBatchEvent(scope.row)">启用</el-button>
              <!-- <el-button size="mini" type="text" icon="el-icon-edit"
                  v-if="selectable(scope.row) || (!selectable(scope.row) && scope.row.status == 0)"
                  @click="handleUpdate(scope.row)">修改</el-button> !selectable(scope.row)||isEditShow-->
              <el-button size="mini" type="text" icon="el-icon-edit"
                         v-if="(selectable(scope.row) && scope.row.status == 0) || isEditShow"
                         @click="blurUpdate(scope.row)">修改</el-button>
              <el-button size="mini" type="text" icon="el-icon-delete"
                         v-if="(selectable(scope.row) && scope.row.status == 0)"
                         @click="handleDelete(scope.row, 1)">删除</el-button>

            </template>
          </el-table-column>
        </el-table>
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :pageSizes.sync="pageSizes"
                    :limit.sync="queryParams.pageSize" @pagination="getList" />
      </div>

    </el-row>

    <!-- 排班预览 -->
    <el-dialog :title="detailTitle" :visible.sync="detailDialogVisible" width="100%" center
               :close-on-click-modal="false" @close="closefullScreen" class="detailD" v-dialogDrag>
      <div class="weekDialog">
        <el-radio-group v-model="weekradio" @input="changeweekradio">
          <el-radio :label="item" border v-for="(item, index) in allWeek" :key="index">
            第{{ item.week }}周
            ({{ getshowDate(item.week, item.year)[0] }} ~ {{ getshowDate(item.week, item.year)[1] }})
          </el-radio>
        </el-radio-group>

      </div>
      <div style="margin-top:30px">
        <el-row v-if="retablesAllLists && retablesAllLists.length > 0">
          <el-col :xs="24" :sm="11" :md="6" :lg="4" :xl="4" v-for="(items, indexs) in retablesAllLists"
                  :key="indexs" style="margin-top:20px;margin-left:10px; ">
            <el-card :body-style="{ padding: '10px' }">

              <div style="font-size:20px;text-align:center;font-weight:700;position: relative;">
                <span style="color:red;font-size:16px;">(第{{ splitDate(items.schedulingDate) }}周)</span>
                {{ items.schedulingDate }}{{ items.week }}
                <div class="btnGroup">

                </div>
              </div>


              <div
                style="font-size:20px;font-weight:700;margin:20px 5px;display:flex;justify-content: space-between;align-items: center;">
                上午
                <el-button @click="handleOldWeek(3, items.schedulingDate)" size="mini"
                           type="success">引用到下一天</el-button>
              </div>


              <el-table :data="items.sarr" style="width: 100%">
                <el-table-column prop="medicalEquipment" label="项目" align="center">
                </el-table-column>
                <el-table-column prop="appointmentsNumber" label="人数" width="50" align="center">
                </el-table-column>
                <el-table-column prop="schedulingDoctorNickname" label="医生" align="center">

                </el-table-column>
                <!-- <el-table-column prop="remark" label="备注">

            </el-table-column> -->
              </el-table>
              <!-- <div style="padding:8px;margin:10px 0px" v-for="(item, index) in items.sysAppointmentSchedulings"
              :key="'a' + index" class="appointCard">
              <span>{{ item.medicalEquipment }}</span>
              <span style="color:red">{{ item.appointmentsNumber }}人</span>
              <span>{{ item.schedulingDoctorNickname }}</span>
              <span v-if="item.remark">备注：{{ item.remark }}</span>
          </div> -->
              <div style="height:1px;background:red;"></div>
              <div style="font-size:20px;font-weight:700;margin:20px 5px;">下午</div>
              <el-table :data="items.xarr" style="width: 100%">
                <el-table-column prop="medicalEquipment" label="项目" align="center">
                </el-table-column>
                <el-table-column prop="appointmentsNumber" label="人数" width="50" align="center">
                </el-table-column>
                <el-table-column prop="schedulingDoctorNickname" label="医生" align="center">

                </el-table-column>
                <!-- <el-table-column prop="remark" label="备注">

            </el-table-column> -->
              </el-table>

            </el-card>
          </el-col>
        </el-row>
        <el-row v-else>
          <div style="height:700px;text-align:center;font-size:26px;"> 暂无排期</div>

        </el-row>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="handleOldWeek(1)">引用到下周</el-button>
        <el-button @click="getenableSchedulingBatchEvent(tablesAllLists, 2)">全部启用</el-button>
        <el-button @click="detailDialogVisible = false">关闭</el-button>
      </div>
    </el-dialog>
    <!-- 排班周次选择预览 -->
    <el-dialog title="选择预览周次" :visible.sync="weekDialogVisible" width="70%" center :close-on-click-modal="false"
               v-dialogDrag>
      <div class="weekDialog">
        <el-radio-group v-model="weekradio" @input="changeweekradio">
          <el-radio :label="item" border v-for="(item, index) in allWeek" :key="index">
            第{{ item.week }}周
            ({{ getshowDate(item.week, item.year)[0] }} ~ {{ getshowDate(item.week, item.year)[1] }})
          </el-radio>
        </el-radio-group>

      </div>
      <div slot="footer" class="dialog-footer">
        <!-- <el-button @click="preciewComfire">预览</el-button> -->
        <el-button @click="weekDialogVisible = false">关闭</el-button>
      </div>
    </el-dialog>
    <Screenfull v-show="false" ref="Screenfull"></Screenfull>
    <!-- 弹出预约提示 -->
    <el-dialog title="启用信息" :visible.sync="appointTipDialogVisible" v-dialogDrag width="70%" append-to-body
               :close-on-click-modal="false">
      <appointTip v-if="appointTipDialogVisible" :appointItem="appointItem" type="2"
                  @closeappointTipDialogVisible="closeappointTipDialogVisible" @comfirm="sureComfire">
      </appointTip>
    </el-dialog>
  </div>
</template>

<script>
import { mapGetters } from "vuex";
import { getListUser } from "@/api/system/user";
import { deptNameList } from "@/api/system/dept";
import {
  listPlan, listPlanDept,
} from "@/api/system/plan";
import {appointmentschedulingNum, addScheduling, updateScheduling, listScheduling, delScheduling, quoteScheduling, getScheduling, listAllScheduling, enableScheduling, addSchedulingBatch, getSchedulingDate, getenableSchedulingBatch, getSchedulingenableBatch } from "@/api/appointManage/appointManage";
import { getToken } from "@/utils/auth";
import departTag from "@/views/components/department/departTag.vue";
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
import department from "@/views/components/department/index.vue";
import Screenfull from "@/components/Screenfull";
import appointTip from "@/views/components/customerDetail/appointTip.vue";
export default {
  name: "textManage",
  dicts: ["sys_textmanage_type", 'sys_manage_diseases'],
  components: { department, departTag, Screenfull, appointTip },
  data() {
    let self = this
    return {
      pageSizes: [15,20, 30, 50],
      pickerOptions0: {
        disabledDate(time) {
          return time.getTime() < Date.now() - 8.64e7;//如果没有后面的-8.64e7就是不可以选择今天的
        }
      },
      // 获取本月的第一天
      // var firstDayOfMonth = new Date(today.getFullYear(), today.getMonth(), 1);

      // // 获取本月的最后一天
      // var lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0);

      pickerOptions: {
        shortcuts: [{
          text: '今天',
          onClick(picker) {
            const end = new Date();
            const start = new Date();
            picker.$emit('pick', [start, end]);
          }
        }, {
          text: '本月',
          onClick(picker) {
            const today = new Date();
            const firstDayOfMonth = new Date(today.getFullYear(), today.getMonth(), 1);
            const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0);
            picker.$emit('pick', [firstDayOfMonth, lastDayOfMonth]);
          }
        }, {
          text: '上周(' + self.setWeekText(self.splitDate("", 1) - 1) + ')',
          onClick(picker) {
            self.dateSelect = -1
            picker.$emit('pick', [self.getTime(7), self.getTime(1)]);
          }
        }, {
          text: '本周(' + self.setWeekText(self.splitDate("", 1)) + ')',
          onClick(picker) {
            self.dateSelect = 0
            picker.$emit('pick', [self.getTime(0), self.getTime(-6)]);
          }
        }, {
          text: '下周(' + self.setWeekText(self.splitDate("", 1) + 1) + ')',
          onClick(picker) {
            self.dateSelect = 1
            picker.$emit('pick', [self.getTime(-7), self.getTime(-13)]);
          }
        }, {
          text: self.setWeekText(self.splitDate("", 1) + 2),
          onClick(picker) {
            picker.$emit('pick', [self.getTime(-14), self.getTime(-20)]);
          }
        }, {
          text: self.setWeekText(self.splitDate("", 1) + 3),
          onClick(picker) {
            picker.$emit('pick', [self.getTime(-21), self.getTime(-27)]);
          }
        }, {
          text: self.setWeekText(self.splitDate("", 1) + 4),
          onClick(picker) {
            picker.$emit('pick', [self.getTime(-28), self.getTime(-34)]);
          }
        }, {
          text: self.setWeekText(self.splitDate("", 1) + 5),
          onClick(picker) {
            picker.$emit('pick', [self.getTime(-35), self.getTime(-41)]);
          }
        }]
      },
      retablesAllLists: [],
      dateSelect: -2,
      detailTitle: '治疗预约排班预览',
      detailDialogVisible: false,
      treatmentDoctorUsersList: [],//治疗医生
      value1: '',
      printDialogVisible: false,
      weekDialogVisible: false,
      sysUseTypeArr: [
        { label: '上午', value: 0 },
        { label: '下午', value: 1 }

      ],


      weekNum: undefined,
      editor: null,
      // 遮罩层
      loading: true,
      printInfo: {},
      // 选中数组
      ids: [],
      diseaseClassifyName: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 专病表格数据
      tablesList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 日期范围
      dateRange: [],
      // 是否修改
      inputDisabled: false,
      // 表单参数
      // form: {},
      form: {
        schedulingId: undefined,
        schedulingDate: '',
        week: '',
        timeSlot: 0,
        planId: '',
        medicalEquipment: '',
        appointmentsNumber: '',
        schedulingDoctorUsername: '',
        schedulingDoctorNickname: '',
        deptId: '',
        hospitalId: '',
        remark: ''
      },
      tablesAllLists: [],
      detectionType: [],//可选的 检测指标  （接口返回）仅前端用
      singlePlanList: [],
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 15,
        hospitalId: undefined,
        deptId: undefined

      },
      schedulingDate: '',
      deptNameLists: [],
      // 表单校验
      rules: {
        schedulingDate: [
          {
            required: true,
            message: "日期必选!",
            trigger: "blur",
          },
        ],
        deptId: [
          {
            required: true,
            message: "科室必选!",
            trigger: "blur",
          },
        ],
        // planId: [
        //     {
        //         required: true,
        //         message: "治疗项目必选!",
        //         trigger: "blur",
        //     },
        // ],
        appointmentsNumber: [
          {
            required: true,
            message: "人数不能为空!",
            trigger: "blur",
          },
        ]

      },
      //是否数组
      checkAll: false,
      checkedCities: [],
      PlanactiveName: '1',
      isUpdateRow: -1,
      isIndeterminate: true,
      allWeek: [],
      weekradio: undefined,
      appointItem: [],
      appointTipDialogVisible: false,
      AllCurrentWeek: 52,
      isEditShow: false,
      statisticalTableH: undefined,
    };
  },
  watch: {
    showSearch() {
      this.$nextTick(() => {
        this.changeHeight()
      }, 1000)

    }
  },
  computed: {
    ...mapGetters(["dept", "hospital", "roles"]),
  },
  created() {
    this.loading = false;
    this.open = true
  },
  updated() {
    this.$nextTick(() => {
      this.$refs.table.doLayout()
    })
  },
  mounted() {
    let rolesTring = ''
    // console.log("999999**************************************************************")
    console.log("this.rolesthis.rolesthis.rolesthis.rolesthis.roles")
    console.log(this.roles)
    if (this.roles && this.roles.length > 0) {
      rolesTring = this.roles.join(',')
      //  console.log("rolesTring" + rolesTring) admin
      if (rolesTring.indexOf('sys_admin') > -1 || rolesTring.indexOf('admin') > -1) {
        this.isEditShow = true
      } else {
        this.isEditShow = false
      }
    } else {
      this.isEditShow = false
    }

  },
  methods: {
    changeHeight() {
      console.log("pppp")
      if (this.$refs.statisticalTable) {
        const statisticalTableObj = this.$refs.statisticalTable.getBoundingClientRect();
        let h = statisticalTableObj.top +100
        this.statisticalTableH = 'calc(100vh - ' + h + 'px)'
      } else {
        this.statisticalTableH = '500px'
      }
    },
    setWeekText(num) {
      const now = new Date();
      const fullyear = now.getFullYear();
      //本周
      var date0 = new Date();
      let dayWeek = this.getYearWeek(date0.getFullYear(), date0.getMonth() + 1, date0.getDate())
      let AllCurrentWeek = this.getNumOfWeeks(fullyear)
      let preAllCurrentWeek = this.getNumOfWeeks(fullyear - 1)
      if (num > 0) {
        if (num > AllCurrentWeek) {
          return fullyear + 1 + '第' + (num - AllCurrentWeek) + '周'
        } else {
          return '第' + (num) + '周'
        }
      } else {
        return fullyear - 1 + '第' + (preAllCurrentWeek) + '周'
      }

    },
    handleCheckAllChange(val) {
      this.checkedCities = val ? this.singlePlanList : [];
      this.isIndeterminate = false;
    },
    handleCheckedCitiesChange(value) {
      let checkedCount = value.length;
      this.checkAll = checkedCount === this.singlePlanList.length;
      this.isIndeterminate = checkedCount > 0 && checkedCount < this.singlePlanList.length;
    },
    InputWeek() {
      if (this.weekNum) {
        let currentWeek = this.splitDate('', 1)
        let yNum = Number(this.weekNum) - currentWeek
        this.dateRange = [this.getTime(-7 * yNum), this.getTime(-7 * yNum - 6)]
        this.handleQuery()
      } else {
        this.handleQuery()
      }

    },
    getYearWeek(a, b, c) {
      /*
      date1是当前日期
      date2是当年第一天
      d是当前日期是今年第多少天
      用d + 当前年的第一天的周差距的和在除以7就是本年第几周
      */
      var date1 = new Date(a, parseInt(b) - 1, c),
        date2 = new Date(a, 0, 1),
        d = Math.round((date1.valueOf() - date2.valueOf()) / 86400000);
      //判断是周的 周几
      if (date1.getDay() == 0) {// 周日 ，也就是本周周数 +1
        // return Math.ceil((d + ((date2.getDay() + 1) - 1)) / 7) + 1; //西方时间
        return Math.ceil((d + ((date2.getDay() + 1) - 1)) / 7) ; //东方时间
      } else {
        return Math.ceil((d + ((date2.getDay() + 1) - 1)) / 7)
      }

    },
    splitDate(date, type) {
      if (type == 1) {//本周
        var date0 = new Date();
        return this.getYearWeek(date0.getFullYear(), date0.getMonth() + 1, date0.getDate())
      } else {
        if (date) {
          let dateArr = date.split('-')

          return this.getYearWeek(dateArr[0], dateArr[1], dateArr[2])
        }
      }

    },
    splitDate0(date, type) {
      if (type == 1) {//本周
        var date0 = new Date();
        return this.getYearWeek(date0.getFullYear(), date0.getMonth() + 1, date0.getDate())
      } else {
        if (date) {
          let dateArr = date.split('-')
          //判断是否是当年的
          let myDate = new Date();
          let fullYear = myDate.getFullYear()
          console.log(fullYear)
          let yearC = dateArr[0] - fullYear
          console.log(yearC)
          let obj = {
            week: this.getYearWeek(dateArr[0], dateArr[1], dateArr[2]),
            year: yearC,
            date: date
          }
          return obj
        }
      }

    },
    // 回显医院及门诊
    getdeptNameList() {
      deptNameList().then((response) => {
        this.deptNameLists = response.data;
        this.handleWeek(1);
      });
    },
    handleOldWeek(type, date) {

      if (type == 1) {
        this.form.hospitalId = this.queryParams.hospitalId
        this.form.deptId = this.queryParams.deptId
        if (this.form.deptId == undefined || this.form.deptId == null || this.form.deptId == '') { //请选择科室
          this.$message.warning("请选择科室!");
          return false
        }
      } else if (type = 3) {
        this.form.hospitalId = this.queryParams.hospitalId
        this.form.deptId = this.queryParams.deptId
        if (this.form.deptId == undefined || this.form.deptId == null || this.form.deptId == '') { //请选择科室
          this.$message.warning("请选择科室!");
          return false
        }
        this.schedulingDate = date
      } else {
        if (this.form.deptId == undefined || this.form.deptId == null || this.form.deptId == '') { //请选择科室
          this.$message.warning("请选择科室!");
          return false
        }
        this.schedulingDate = this.form.schedulingDate
      }
      let that = this
      let week = that.splitDate(that.schedulingDate)
      let title, title0;

      if (type == 1) {
        title = `第${week}周 (${that.getshowDate(week)[0]} ~ ${that.getshowDate(week)[1]})`
        title0 = `第${week + 1}周 (${that.getshowDate(week + 1)[0]} ~ ${that.getshowDate(week + 1)[1]})`
      } else if (type == 3) {
        title = that.schedulingDate
        title0 = that.GetNextDay(that.schedulingDate)
      }
      this.$modal.confirm(
        '是否确认将"' +
        title +
        '"的排班引用到"' + title0 + '"'
      )
        .then(function () {
          let params = {
            hospitalId: that.form.hospitalId,
            deptId: that.form.deptId,
            type: type,
            schedulingDate: that.schedulingDate
          }
          quoteScheduling(params).then((response) => {
            if (response.code == 200) {
              that.$modal.msgSuccess("引用成功");
              that.reset()
              that.getList(type);
              if (type == 3) {
                that.changeweekradio()
              }
            }
          });

        })
        .catch(() => { });

    },
    GetNextDay(date) {
      let today = new Date(date);
      let yesterday_milliseconds = today.getTime() + 1000 * 60 * 60 * 24;
      let yesterday = new Date();
      yesterday.setTime(yesterday_milliseconds);
      let strYear = yesterday.getFullYear();
      let strDay = yesterday.getDate();
      let strMonth = yesterday.getMonth() + 1;
      if (strMonth < 10) {
        strMonth = "0" + strMonth;
      }
      if (strDay < 10) {
        strDay = "0" + strDay;
      }
      return strYear + "-" + strMonth + "-" + strDay;
    },

    selectable(row, index) {
      var strtime = row.schedulingDate.replace("/-/g", "/");//时间转换
      var date1 = new Date(strtime);//现在时间
      var date2 = new Date();
      var d2 = date2.getFullYear() + "/" + (date2.getMonth() + 1) + "/" + date2.getDate()
      var date3 = new Date(d2);
      //判断时间是否过期
      return date1 < date3 ? false : true;
    },
    rowable(row, index) {
      if (this.selectable(row) && row.status == 0) {
        return true
      } else {
        return false
      }

    },
    getName(type) {
      let textValue = "";
      if (type == 2) {
        this.treatmentDoctorUsersList.forEach((item) => {
          if (item.userName == this.form.schedulingDoctorUsername) {
            textValue = item.nickName;
          }
        });
        this.form.schedulingDoctorNickname = textValue;
      } else if (type == 1) {
        this.singlePlanList.forEach((item) => {
          if (item.planId == this.form.planId) {
            textValue = item.medicalEquipment;
          }
        });
        this.form.medicalEquipment = textValue;
      }

    },
    refreshData(data) {
      this.queryParams.pageNum = 1;
      this.queryParams.hospitalId = data.hospitalId
      this.queryParams.deptId = data.deptId

      this.getdeptNameList()
    },
    changedepatData(data) {
      if (data && data.length > 0) {
        this.form.deptId = data[data.length - 1].deptId
        this.form.hospitalId = data[data.length - 1].parentId
      } else {
        this.form.deptId = undefined
        this.form.hospitalId = undefined
      }
      // console.log(data)
      this.getSinglePlanList()
      this.getTreatmentDoctorUsersList()
    },
    getTime(n) {
      var now = new Date();
      var year = now.getFullYear();
      //因为月份是从0开始的,所以获取这个月的月份数要加1才行
      var month = now.getMonth() + 1;
      var date = now.getDate();
      var day = now.getDay();
      // console.log(date);
      //判断是否为周日,如果不是的话,就让今天的day-1(例如星期二就是2-1)
      if (day !== 0) {
        n = n + (day - 1);
      } else {
        // n = n + day  //西方时间
        n = n + 6    //东方时间
      }
      if (day) {
        //这个判断是为了解决跨年的问题
        if (month > 1) {
          month = month;
        }
        //这个判断是为了解决跨年的问题,月份是从0开始的
        else {
          year = year - 1;
          month = 12;
        }
      }
      // console.log(now)
      // console.log(day)
      now.setDate(now.getDate() - n);
      year = now.getFullYear();
      month = now.getMonth() + 1;
      date = now.getDate();
      // console.log("星期几"+n);
      // console.log(s)
      var s = year + "-" + (month < 10 ? ('0' + month) : month) + "-" + (date < 10 ? ('0' + date) : date);
      return s;
    },
    handleWeek(num) {
      this.dateSelect = num
      if (num == -1) {
        //上周的开始时间
        console.log(this.getTime(7));
        //上周的结束时间
        console.log(this.getTime(1));
        this.dateRange = [this.getTime(7), this.getTime(1)]
      } else if (num == 0) {
        //本周的开始时间
        console.log(this.getTime(0));
        //本周的结束时间
        console.log(this.getTime(-6));
        this.dateRange = [this.getTime(0), this.getTime(-6)]
      } else if (num == 1) {
        //下周的开始时间
        console.log(this.getTime(-7));
        //下周结束时间
        console.log(this.getTime(-13));
        this.dateRange = [this.getTime(-7), this.getTime(-13)]
      } else if (num == -3) {//默认查本月的排班
        const today = new Date();
        const firstDayOfMonth = new Date(today.getFullYear(), today.getMonth(), 1);
        const lastDayOfMonth = new Date(today.getFullYear(), today.getMonth() + 1, 0);
        var time0 = new Date(firstDayOfMonth);
        var time = new Date(lastDayOfMonth);
        var startTime = time0.getFullYear() + '-' + (time0.getMonth() + 1) + '-' + time0.getDate()
        var endTime = time.getFullYear() + '-' + (time.getMonth() + 1) + '-' + time.getDate()


        this.dateRange = [startTime, endTime]
      }
      console.log(this.dateRange)
      if (this.dateRange == null || this.dateRange == undefined) {
        this.dateRange = []
      }
      this.handleQuery()
    },

    getWeeks() {
      let params = {
        startTime: this.dateRange[0] ? this.dateRange[0] : '',
        endTime: this.dateRange[1] ? this.dateRange[1] : '',
        ...this.queryParams
      }
      getSchedulingDate(params).then((response) => {
        if (response.code == 200) {
          let data = response.data
          console.log(data)
          let allWeek = []
          data.forEach((item) => {//
            let weekObj = this.splitDate0(item, 2)
            //  console.log(allWeek)
            console.log("____222222")

            const result = allWeek.find(item => item.week === weekObj.week);
            if (!result) {
              allWeek.push(weekObj)
            }

          })
          console.log("allWeek+++++++++++++++++++")
          console.log(allWeek)
          this.allWeek = allWeek
          this.weekradio = allWeek[0]
          this.changeweekradio(1)
        }


      });


    },
    getNumOfWeeks(year) {
      year = Number(year)
      if (isNaN(year)) return ''
      // 获取这一年的第一天是星期几
      let week = new Date(year, 0, 1).getDay()

      // 闰年366天、平年365天
      let days = ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0) ? 366 : 365
      if (week === 1) {
        // 如果第一号是周一
        return Math.ceil(days / 7)
      } else {
        // 如果不是周一
        return Math.ceil((days - 7 + week) / 7)
      }
    },

    getshowDate(num, year) {
      let currentWeek = this.splitDate('', 1)
      let yNum = Number(num) - currentWeek
      const now = new Date();
      const fullyear = now.getFullYear();
      let AllCurrentWeek = this.getNumOfWeeks(fullyear) //当前年多少周
      if (year && year != 0) {
        if (year > 0) {
          yNum = Number(num) + AllCurrentWeek - currentWeek
        } else {
          // yNum=Number(num) + AllCurrentWeek - currentWeek
        }
      }
      return [this.getTime(-7 * yNum), this.getTime(-7 * yNum - 6)]
    },
    changeweekradio(type) {
      let currentWeek = this.splitDate('', 1)
      console.log("currentWeek" + currentWeek)
      let yNum = 0
      const now = new Date();
      const year = now.getFullYear();
      let AllCurrentWeek = this.getNumOfWeeks(year)
      console.log(this.weekradio)
      if (this.weekradio.constructor === Object) {
        if (this.weekradio.year > 0) {
          yNum = Number(this.weekradio.week) + AllCurrentWeek - currentWeek
        } else {
          yNum = Number(this.weekradio.week) - currentWeek
        }

        // if (this.weekradio.year == undefined || this.weekradio.year == null) {
        //     yNum = Number(this.weekradio) - currentWeek
        // } else {
        //     yNum = Number(this.weekradio.week) + AllCurrentWeek - currentWeek
        // }
      } else {
        yNum = Number(this.weekradio) - currentWeek
      }


      let dateRange = [this.getTime(-7 * yNum), this.getTime(-7 * yNum - 6)]
      console.log("dateRange___________________________dateRange")
      console.log(dateRange)
      this.preciewComfire(dateRange[0], dateRange[1])


    },
    preciewComfire(startTime, endTime) {
      let that = this

      let params = {
        startTime: startTime,
        endTime: endTime,
        ...that.queryParams
      }
      listAllScheduling(params).then((response) => {
        this.schedulingDate = startTime
        this.getRetablesAllLists(response.data)

      });
    },
    closefullScreen() {
      this.$refs.Screenfull.closed()
      this.weekradio = undefined
    },
    getRetablesAllLists(DATA) {
      let dataArr = []
      this.tablesAllLists = DATA;
      DATA.forEach((items) => {
        let obj = {};
        let sarr = [], xarr = [];
        items.sysAppointmentSchedulings.forEach((item) => {//
          if (item.timeSlot == 0) {//上午
            sarr.push(item)
          } else { //下午
            xarr.push(item)
          }

        })
        obj.schedulingDate = items.schedulingDate
        obj.week = items.week
        obj.sarr = sarr
        obj.xarr = xarr
        dataArr.push(obj)
      });

      this.retablesAllLists = dataArr
      this.$refs.Screenfull.open()
      this.detailDialogVisible = true
    },
    PreviewEvent() {
      if (this.queryParams.deptId == undefined || this.queryParams.deptId == null || this.queryParams.deptId == '') { //请选择科室
        this.$message.warning("请选择科室!");
        return false
      }
      // if (this.dateRange && this.dateRange.length == 0) {//没有选择日期
      //     this.$message.warning("请选择查看排班日期!");
      //     return false
      // }
      console.log("日期.....//")
      console.log(this.dateRange)
      this.getWeeks()


    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map((item) => item.schedulingId);
      this.single = selection.length != 1;
      this.multiple = !selection.length;

    },
    changedate() {
      let date = this.form.schedulingDate
      var weekArray = new Array("日", "一", "二", "三", "四", "五", "六");
      var week = weekArray[new Date(date).getDay()];//注意此处必须是先new一个Date

      this.form.week = "周" + week;
    },

    // getIndex(index) {
    //     return index + 1;
    // },
    changeColorValue(e) {
      console.log(e)
    },

    //查询治疗医生列表
    getTreatmentDoctorUsersList() {
      if (this.form.hospitalId) {
        getListUser({ funcRole: '3', hospitalId: this.form.hospitalId,deptId:this.form.deptId }).then((response) => {
          if (response.code == 200) {
            this.treatmentDoctorUsersList = response.data
          }
        });
      } else {
        this.treatmentDoctorUsersList = []
      }

    },
    /** 治疗项目 */
    getSinglePlanList() {
      if (this.form.hospitalId) {
        listPlanDept({
          pageNum: 1,
          pageSize: 9999,
          status: 0,
          deptId: this.form.deptId,
          planCategoryId: "2"
        }).then(
          (response) => {
            this.singlePlanList = response.rows;
            this.$nextTick(() => {
                this.changeHeight()
            }, 1000)
          }
        );
      } else {
        this.singlePlanList = []
      }

    },


    // 真实序号计算（计算分页影响）
    getIndex(index) {
      return (this.queryParams.pageNum - 1) * this.queryParams.pageNum + index + 1;
    },
    /** 查询设备列表 */
    getList(type) { // this.queryParams
      this.loading = false;
      let that = this
      let params = {
        startTime: that.dateRange[0],
        endTime: that.dateRange[1],
        ...that.queryParams
      }
      listScheduling(params).then((response) => {
        this.tablesList = response.rows;
        this.total = response.total;
        this.loading = false;
        if (type != 3) {
          this.detailDialogVisible = false
        }

      });
    },


    // 表单重置
    reset() {
      this.form = {
        schedulingId: undefined,
        schedulingDate: '',
        week: '',
        timeSlot: 0,
        planId: '',
        medicalEquipment: '',
        appointmentsNumber: '',
        schedulingDoctorUsername: '',
        schedulingDoctorNickname: '',
        deptId: undefined,
        hospitalId: undefined,
        remark: ''
      },
        this.isUpdateRow = -1
      this.checkAll = false
      this.checkedCities = []//治疗项目
      this.open = false
      this.getSinglePlanList()
      this.getTreatmentDoctorUsersList()
      setTimeout(() => {
        this.open = true
      }, 300);
      this.resetForm("form");
    },
    halfReset() {
      this.form.schedulingId = undefined
      this.checkedCities = []//治疗项目
      this.form.planId = ''
      this.form.medicalEquipment = ''
      // this.form.appointmentsNumber = ''
      this.form.schedulingDoctorUsername = ''
      this.form.schedulingDoctorNickname = ''
      this.form.remark = ''
      this.checkAll = false
      this.isUpdateRow = -1
      console.log("不清空")
      // this.getSinglePlanList()
      // this.getTreatmentDoctorUsersList()
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.dateRange = [];
      this.resetForm("queryForm");
      this.handleQuery();
    },


    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      this.open = false
      const schedulingId = row.schedulingId;
      getScheduling(schedulingId).then((response) => {
        let data = response.data;
        this.form = data
        this.getSinglePlanList()
        this.getTreatmentDoctorUsersList()
        this.open = true
      });
    },
    //启用排班前 查询已经预约的 信息
    closeappointTipDialogVisible() {
      this.appointTipDialogVisible = false
    },
    sureComfire(data) {//确认启用
      let arr = data
      // this.form.open=obj.open?1:0
      let params = []
      arr.forEach((item) => {
        let obj = {}
        obj.schedulingId = item.schedulingId,
          obj.open = item.open ? 1 : 0
        params.push(obj)
      });
      this.suregetSchedulingenableBatch(params)
    },
    suregetSchedulingenableBatch(params) { // getSchedulingenableBatch
      console.log(params)
      let that = this
      this.$modal
        .confirm(
          '是否确认启用批量的排班？'
        )
        .then(function () {
          console.log("99999")
          getSchedulingenableBatch(params).then((response) => {
            that.getList();
            that.$modal.msgSuccess("启用成功");
            that.appointTipDialogVisible = false
          });

        })
        .catch(() => { });
    },
    getenableSchedulingBatchEvent(row, type) { //查询
      let title;
      let schedulingIds;
      let that = this
      if (type == 2) {

        let data = row
        let arr = []
        data.forEach((items) => {
          items.sysAppointmentSchedulings.forEach((item) => {
            arr.push(item.schedulingId)
          })
        });
        schedulingIds = arr.join(',');

      } else if (type == 3) {
        schedulingIds = this.ids.join(',');

      } else {

        schedulingIds = row.schedulingId;
      }
      getenableSchedulingBatch(schedulingIds).then((response) => {//弹出查询信息
        if (response.code == 200) {
          this.appointTipDialogVisible = false
          let data = response.data
          //查询信息，弹出提示
          console.log(data)
          this.appointItem = data
          this.appointTipDialogVisible = true
        }
      });
    },
    handleUpdateStatus(row, type) {
      let title;
      let schedulingIds;
      let that = this
      if (type == 2) {
        title = this.dateRange[0] + '~' + this.dateRange[1]  //排期
        let data = row
        let arr = []
        data.forEach((items) => {
          items.sysAppointmentSchedulings.forEach((item) => {
            arr.push(item.schedulingId)
          })
        });
        schedulingIds = arr.join(',');

      } else if (type == 3) {
        schedulingIds = this.ids.join(',');
        title = '批量'
      } else {
        title = row.schedulingDate + row.week
        schedulingIds = row.schedulingId;
      }
      this.$modal
        .confirm(
          '是否确认启用' +
          title +
          '的排班？'
        )
        .then(function () {
          console.log("99999")
          enableScheduling(schedulingIds).then((response) => {
            that.getList();
            that.$modal.msgSuccess("启用成功");
          });

        })
        .catch(() => { });
    },
    blurUpdate(row) {
      this.isUpdateRow = row.schedulingId
    },
    comfireBlur(row) {
      let params = row
      if (params.appointmentsNumber == undefined || params.appointmentsNumber == null || params.appointmentsNumber == '') {
        this.$message.warning("可约人数不能为空!");
      } else {
        if (row.status == 1) {
          appointmentschedulingNum(params).then((response) => {
            if (response.code == 200) {
              this.$modal.msgSuccess("修改成功");
              this.reset()
              this.getList();
              this.isUpdateRow = -1
            } else {
              this.$message.warning(response.msg);
            }
          });
        } else {
          updateScheduling(params).then((response) => {
            if (response.code == 200) {
              this.$modal.msgSuccess("修改成功");
              this.reset()
              this.getList();
              this.isUpdateRow = -1
            } else {
              this.$message.warning(response.msg);
            }
          });
        }

      }

    },
    /** 提交按钮 */
    submitForm: function () {
      this.$refs["form"].validate((valid) => {
        let that = this
        if (valid) {
          if (this.form.schedulingId != undefined) {

            updateScheduling(this.form).then((response) => {
              if (response.code == 200) {
                this.$modal.msgSuccess("修改成功");
                this.reset()
                this.getList();
                this.isUpdateRow = false
              }
            });
          } else {
            //单个添加
            // addScheduling(this.form).then((response) => {
            //     if (response.code == 200) {
            //         this.$modal.msgSuccess("新增成功");
            //         this.halfReset()
            //         this.getList();
            //     }

            // });
            if (this.checkedCities && this.checkedCities.length > 0) {
              let data = this.checkedCities
              console.log(data)
              let params = []
              let obj0 = this.form
              data.forEach((items, index) => {
                let obj = {}
                obj.schedulingDate = obj0.schedulingDate
                obj.schedulingId = obj0.schedulingId
                obj.week = obj0.week
                obj.timeSlot = obj0.timeSlot
                obj.appointmentsNumber = obj0.appointmentsNumber
                obj.schedulingDoctorUsername = obj0.schedulingDoctorUsername
                obj.schedulingDoctorNickname = obj0.schedulingDoctorNickname
                obj.deptId = obj0.deptId
                obj.hospitalId = obj0.hospitalId
                obj.remark = obj0.remark
                obj.planId = items.planId
                obj.medicalEquipment = items.medicalEquipment
                params.push(obj)
              });
              console.log(params)

              //批量添加  addSchedulingBatch
              addSchedulingBatch(params).then((response) => {
                if (response.code == 200) {
                  this.$modal.msgSuccess("新增成功");
                  this.halfReset()
                  this.getList();
                }

              });

            } else {
              this.$message.warning("请选择治疗项目");
            }

          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row, type) {
      if (type == 1) {//单个删除
        const title = row.schedulingDate + row.week
        const schedulingId = row.schedulingId;
        this.$modal
          .confirm(
            '是否确认"' +
            title +
            '"的数据项？'
          )
          .then(function () {
            return delScheduling(schedulingId);
          })
          .then(() => {
            this.getList();
            this.$modal.msgSuccess("删除成功");
          })
          .catch(() => { });
      } else {//批量删除
        const schedulingId = this.ids.join(',');
        this.$modal
          .confirm(
            '是否确认批量删除的数据项？'
          )
          .then(function () {
            return delScheduling(schedulingId);
          })
          .then(() => {
            this.getList();
            this.$modal.msgSuccess("删除成功");
          })
          .catch(() => { });
      }

    },

  },
};
</script>
<style scoped>
::v-deep .el-form.searchForm .appointePicker .el-input__inner{
  padding-left:26px!important;
}
::v-deep .appointeCollapse .el-collapse-item__content{
  padding-bottom:0px!important;
}
::v-deep .appointeCollapse .el-checkbox__label{
  font-size:13px;
}

::v-deep .appointeCollapse .el-collapse-item__content .el-checkbox{
  font-size:12px;
}
.btnGroup {
  position: absolute;
  top: 0px;
  right: 10px;
}

::v-deep .el-dialog {
  margin-top: 0 !important;
}

.btn {
  border: 1px solid red;
  color: red;
}

.el-tag {
  margin-right: 15px;

}

.weekDialog {
  display: flex;
  max-width: 100%;
  overflow-y: auto;
  white-space: nowrap;
}

::v-deep .weekDialog::-webkit-scrollbar {
  height: 6px;
}

::v-deep .weekDialog::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background-color: #f3a4a1;
}

::v-deep .weekDialog::-webkit-scrollbar-track {
  border-radius: 8px;
  background-color: #e7e7e7;
  border: 1px solid #cacaca;
}

::v-deep .weekDialog .el-radio--medium.is-bordered {
  margin: 10px !important;
}

::v-deep .el-form-item__content {
  height: 36px;
}

::v-deep .el-collapse-item__header {
  border-bottom: none;
}

::v-deep .el-collapse-item__wrap {
  border-bottom: none;
}

::v-deep .inputNum .el-input__inner {
  padding: 0px;
  text-align: center;
}

.appointCard>span {
  display: inline-block;
  margin-left: 8px;
  font-size: 16px;
}

.appointCard>span:first-child {
  margin-left: 0px;
}
</style>
